/*
 * @brief:  This file is part of doge_cmd 
 * @date :  2022-07-18
 * @version : v1.0.0
 * @Change Logs:   
 * @date         author         notes:  
 * 2022-07-18    guangjieMVP    first version
 */
#ifndef _DOGE_CMD_H_
#define _DOGE_CMD_H_

#define DOGE_CMD_MAX_LEN   10      /* Maximum length of a command name*/ 
#define DOGE_CMDS_MAX     20       /* Maximum number of commands */ 

typedef void (*doge_cmd_cb)(int argc, char **argv);   // char argv[][CMD_ONE_ARG_MAX_LEN]

#define DOGE_CMD_COUNTOF(a) (sizeof(a)/sizeof(a[0]))

typedef struct doge_command {
	char cmd[DOGE_CMD_MAX_LEN];
	doge_cmd_cb cb;
}doge_cmd_t;

/*
 * str - buffer of cmd line
 * cmds - list of commands
 * cmds_len - number of commands
*/
void doge_cmd_parse(char *str,  doge_cmd_t *cmds, int cmds_len);

#endif


